﻿// -----------------------------------------------------------------------
// <summary>
//  A module in Prism is a logical unit in your application.
// </summary>
// <copyright file="AdvertisementView.xaml.cs" company="DSSoftLogic">
//     Copyright@ DSSoftLogic 2011, Non-Commercial. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------
namespace Property.Silverlight.View
{
    using System.ComponentModel.Composition;
    using System.Windows.Controls;
    using System.Windows.Navigation;
    using Property.Silverlight.Infrastructure;

    /// <summary>
    /// <see cref="Page"/> class providing the main UI for the application.
    /// </summary>
    ////[ViewExport(RegionName = "MainRegion")]
    ////[PartCreationPolicy(CreationPolicy.NonShared)]
    public partial class AdvertisementView : Page, IAdvertisementView
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AdvertisementView"/> class.
        /// </summary>
        public AdvertisementView()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Gets or sets IAdvertisementView ViewModel.
        /// </summary>
        [Import]
        public IAdvertisementView ViewModel
        {
            get
            {
                return this.DataContext as IAdvertisementView;
            }

            set
            {
                this.DataContext = value;
            }
        }

        /// <summary>
        /// Executes when the user navigates to this page.
        /// </summary>
        /// <param name="e">NavigationEventArgs e</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ////do something here ,
        }
    }
}
